Getting Started: Predix Cookbook

Clone the Predix Cookbook from Enterprise Github

Clone the cookbook from the github repo into your local workspace :

cd ~/Documents/code/coobooks git clone https://github.sw.ge.com/grc-cookbooks/predix.git cd ./predix This cookbook has a .kitchen.yml file with the base configuration pre-defined for convergence. It also comes with a .kitchen.local.yml-example which contains proxy settings for the COE in San Ramon.

Copy the .kitchen.local.yml-example to .kitchen.local.yml so it will be used in your kitchen converge run.

Use Berkshelf to resolve and download all cookbook dependencies by executing berks install.

You can look at the dependency list by looking at the metadata.rb file. You will notice that the Predix recipe depends on the Java, Apt, and Ark cookbooks.

%w{ java apt ark }.each do |cb| depends cb end Converge the code on the local VM

Once berkshelf has downloaded all of the dependent cookbooks, you are ready to try and converge the recipe locally.

Execute kitchen converge to start the build process.

This is where the magic begins, here is a quick outline of what will happen:

TestKitchen will call Vagrant to start up an ubuntu-14.04 image, if this is the first time you are requesting a VM with this OS type, Vagrant will locate a base, generic image from the internet, and download it to your local laptop. This can take a few minutes, and only happens once per OS type. Once the machine image is downloaded, Vagrant will start the VM given the Network, Memory, and CPU parameters defined in the .kitchen.yml or .kitchen.local.yml file Once the VM has booted, TestKitchen will SSH into the machine and attempt to download the chef-client from the internet. Once the chef-client is installed, TestKitchen will inject all of the cookbooks created or downloaded using berkshelf Lastly it will attempt to converge the node, running the recipes defined in the nodes run-list. If all goes well you should now have a fully functional Predix Core installation.

Validate the installation

Login to the VM using kitchen login

You will have full sudo rights on the local vm, simply sudo su - to get root.

By default, Predix is installed in /opt/dsp-k/kernel

The Predix service is controlled by an init script, to see if it's running you can execute (as root): service dsp-k status.

To stop or start Predix Core, execute (as root) service dsp-k stop or service dsp-k start

Predix Core logs can be found in /opt/dsp-k/kernel/log